package sqldbManagement.dblibrary.cj.model;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Random;

public class JDBCModel extends LinkedHashMap<Integer, JDBCModel.Nodes> {

    private static final Random random = new Random();

    public static class Nodes{
        private Code codes;
        private Object obj;

        public Nodes(Code code, Object obj) {
            this.codes = code;
            this.obj = obj;
        }

        @Override
        public String toString() {
            return "Nodes{" +
                    "code=" + codes +
                    ", obj=" + obj +
                    '}';
        }

        public Code getCodes() {
            return codes;
        }

        public void setCodes(Code code) {
            this.codes = code;
        }

        public Object getObj() {
            return obj;
        }

        public void setObj(Object obj) {
            this.obj = obj;
        }
    }

    public JDBCModel add(Code code,Object o){
        this.put(random.nextInt(Integer.MAX_VALUE),new Nodes(code,o));
        return this;
    }
}
